﻿using PMS.Core.Configuration.CommonEnumConfigs;
using PMS.Data.Entities.Customers;

namespace PMS.Services.EntityServices.Customers
{
    /// <summary>
    /// Customer registration request
    /// </summary>
    public class CustomerRegistrationRequest
    {
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="customer">Customer</param>
        /// <param name="password">Password</param>
        /// <param name="passwordFormat">Password format</param>
        /// <param name="passwordStrong">PasswordStrongLevel</param>
        public CustomerRegistrationRequest(Customer customer,
            string password,
            PasswordFormat passwordFormat,
            PasswordStrongLevel passwordStrong,
            bool isOutputPassword = false, 
            bool isBackendRegister = false,
            bool sendWelcomeMail = true)
        {
            Customer = customer;
            Password = password;
            PasswordFormat = passwordFormat;
            PasswordStrongLevel = passwordStrong;
            OutputPasswordInEmail = isOutputPassword;
            IsBackendRegister = isBackendRegister;
            SendWelcomeMail = sendWelcomeMail;
        }

        /// <summary>
        /// Customer
        /// </summary>
        public Customer Customer { get; set; }

        /// <summary>
        /// Password
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 是否需要在欢迎邮件中告知用户密码
        /// 当自动生成用户账号时随机分配密码时需要将随机密码邮件告知用户
        /// </summary>
        public bool OutputPasswordInEmail { get; set; }
        /// <summary>
        /// Password format
        /// </summary>
        public PasswordFormat PasswordFormat { get; set; }

        /// <summary>
        /// Password Strong
        /// </summary>
        public PasswordStrongLevel PasswordStrongLevel { get; set; }

        /// <summary>
        /// 新增注册方式设置，用户注册方式为前台页面注册，则按注册流程注册用户
        /// 用户注册方式为后台管理页注册，则直接注册，无需发送验证邮件等
        /// </summary>
        public bool IsBackendRegister { get; set; }

        /// <summary>
        /// 配合后端新增用户功能，新增一个选项控制是否发送欢迎邮件
        /// </summary>
        public bool SendWelcomeMail { get; set; }
    }
}
